package com.blue.alipay.controller;

import com.alibaba.fastjson.JSON;
import com.blue.alipay.contants.Result;
import com.blue.alipay.utils.controller.BaseController;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @描述 微信小程序的请求
 * @时间 2017-9-28 11:55
 * @作者 肖亦鸣
 */
@Controller
@RequestMapping("wx_sr")
public class WeiXinSmallRoutineController extends BaseController {

    private static Logger logger = LogManager.getLogger(WeiXinSmallRoutineController.class.getName());

    @ResponseBody
    @RequestMapping(value = "test", method = RequestMethod.POST)
    public String test() {
        response.setCharacterEncoding("UTF-8");
        logger.info("requestParams:{}", JSON.toJSONString(request.getParameterMap()));
        Result result = new Result();
        result.setCode(0);
        result.setData("成功啦");
        result.setMessage("success");
        logger.info("result:{}", JSON.toJSONString(result));
        return JSON.toJSONString(result);
    }
}
